const fs=require('fs');
const path=require('path');
module.exports =  class {
    constructor(req) {
        this.req = req;
        this.siteMenu=require('./lib/site-menu').init();
        this.tools = require('./lib/tools');
    }

    static init(req){
        return new this(req);
    }

    get siteInfo() {
        let _siteInfo = {};
        if (this.req && this.req.query.editModel) {
            _siteInfo = require('./config/_site-info');
        } else {
            _siteInfo = require('./config/site-info');
        }
        return _siteInfo;
    }

    get scriptCode(){
        let _scriptCode = {};
        if (this.req && this.req.query.editModel) {
            _scriptCode = require('./config/_script-code');
        } else {
            _scriptCode = require('./config/script-code');
        }
        return _scriptCode;
    }


};
